import { type AgentDTO } from 'src/engine/metadata-modules/ai/ai-agent/dtos/agent.dto';
import { type FlatAgentWithRoleId } from 'src/engine/metadata-modules/flat-agent/types/flat-agent.type';

export const fromFlatAgentWithRoleIdToAgentDto = ({
  applicationId,
  createdAt,
  description,
  evaluationInputs,
  icon,
  id,
  isCustom,
  label,
  modelConfiguration,
  modelId,
  name,
  prompt,
  responseFormat,
  standardId,
  updatedAt,
  workspaceId,
  roleId,
}: FlatAgentWithRoleId): AgentDTO => ({
  createdAt,
  description: description ?? undefined,
  evaluationInputs,
  id,
  isCustom,
  label,
  modelConfiguration: modelConfiguration ?? undefined,
  modelId,
  name,
  prompt,
  responseFormat,
  standardId,
  updatedAt,
  workspaceId,
  applicationId: applicationId ?? undefined,
  icon: icon ?? undefined,
  roleId: roleId ?? undefined,
});
